module.exports = (app) => {
  const {
    router,
    controller,
    middleware: { jwtVerify, lastTime },
  } = app;

  router.get(
    "/api/test",
    controller.counter.test
  );
  router.get(
    "/api/getCounter",
    jwtVerify(),
    lastTime(),
    controller.counter.getCounter
  );
  router.get(
    "/api/getCounterDetail",
    jwtVerify(),
    lastTime(),
    controller.counter.getCounterDetail
  );
  router.post(
    "/api/addCounter",
    jwtVerify(),
    lastTime(),
    controller.counter.addCounter
  );
  router.post(
    "/api/updateCurrentAmount",
    jwtVerify(),
    lastTime(),
    controller.counter.updateCurrentAmount
  );
  router.post(
    "/api/updateOneCounter",
    jwtVerify(),
    lastTime(),
    controller.counter.updateOneCounter
  );
  router.get(
    "/api/deleteOneCounter",
    jwtVerify(),
    lastTime(),
    controller.counter.deleteOneCounter
  );
  router.get(
    "/api/resetOneCounter",
    jwtVerify(),
    lastTime(),
    controller.counter.resetOneCounter
  );
};
